package com.xxx.obj;

import java.io.Serializable;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/7/20 14:48
 * @Copyright 博为峰
 */
//alt + enter
public class Student implements Serializable {
    private static final long serialVersionUID = -4481270820155265549L;
    /*
      当类中没有serialVersionUID常量时，序列化对象时是根据成员变量的权限修饰符，类型，名称等
      生成加密信息写入文件中
      当类中有serialVersionUID常量时，序列化对象时是根据serialVersionUID的值
      生成加密信息写入文件中
     */

//    private static final long serialVersionUID = 1L;

    private String name;
    //瞬态
    public transient int age;
    public static String sex;

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
